package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.system.SysFence;
import com.ruoyi.system.mapper.SysFenceMapper;
import com.ruoyi.system.service.ISysFenceService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 电子围栏Service业务层处理
 *
 * @author ruoyi
 * @date 2023-05-22
 */
@Service
public class SysFenceServiceImpl implements ISysFenceService {
    @Resource
    private SysFenceMapper fenceMapper;

    /**
     * 查询电子围栏
     *
     * @param fenceId 电子围栏id
     * @return 电子围栏
     */
    @Override
    public SysFence selectFenceById(Long fenceId) {
        return fenceMapper.selectFenceById(fenceId);
    }

    /**
     * 查询电子围栏列表
     *
     * @param sysFence 电子围栏
     * @return 电子围栏
     */
    @Override
    public List<SysFence> selectfenceList(SysFence sysFence) {
        return fenceMapper.selectfenceList(sysFence);
    }

    /**
     * 新增电子围栏
     *
     * @param sysFence 电子围栏
     * @return 结果
     */
    @Override
    public int insertFence(SysFence sysFence) {
        return fenceMapper.insertFence(sysFence);
    }

    /**
     * 修改电子围栏
     *
     * @param sysFence 电子围栏
     * @return 结果
     */
    @Override
    public int updateFence(SysFence sysFence) {
        return fenceMapper.updateFence(sysFence);
    }

    /**
     * 批量删除电子围栏
     *
     * @param fenceIds 需要删除的电子围栏主键
     * @return 结果
     */
    @Override
    public int deleteFenceByFenceIds(Long[] fenceIds) {
        return fenceMapper.deleteFenceByFenceIds(fenceIds);
    }

    /**
     * 删除电子围栏信息
     *
     * @param electronicFenceId 电子围栏主键
     * @return 结果
     */
    @Override
    public int deleteElectronicFenceByElectronicFenceId(Long electronicFenceId) {
        return fenceMapper.deleteElectronicFenceByElectronicFenceId(electronicFenceId);
    }

    @Override
    public List<SysFence> selectFenceListByScenicId(Long scenicId) {
        return fenceMapper.selectFenceListByScenicId(scenicId);
    }
}
